package 初级算法;

public class 反转字符串 {

    public static void main(String[] args) {
        char[] s = new char[]{'h','e','l','l','o'};
        reverseString(s);
        System.out.println(s);
    }
    public static void reverseString(char[] s) {
        for (int i = 0; i < s.length/2; i++) {
            char t = s[s.length-1-i];
            s[s.length-1-i] = s[i];
            s[i] = t;
        }
    }

}
